import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import pxToVp from 'postcss-px-to-viewport'
// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      '/api': {
        target: 'https://api-ticket.liulongbin.top',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    }
  },
  css:{
    postcss:{
      plugins:[
        pxToVp({
  unitToConvert: 'px',
  viewportWidth: 375,
  unitPrecision: 5,
  propList: ['*'],
  viewportUnit: 'vw',
  fontViewportUnit: 'vw',
  selectorBlackList: [],
  minPixelValue: 1,
  mediaQuery: false,
  replace: true,
  exclude: [],
  landscape: false,
  landscapeUnit: 'vw',
  landscapeWidth: 568
})
      ]
    }
  }
})
